package com.bean.service;

import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.web.context.ContextLoader;

import javax.annotation.Resource;

@Service()
public class SecondService {

    public void secondMethod(){
        ApplicationContext applicationContext = ContextLoader.getCurrentWebApplicationContext();
        applicationContext.getBean("SecondService");
        System.out.println("second method run");
        
    }
}
